﻿using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;//NuGet添加json包并在程序管理包控制台输入Install-Package Newtonsoft.Json


namespace TheCell
{
    public class JsonUtils
    {
        public static void Serialize(string fileFullPath, object cells)
        {
            string content = JsonConvert.SerializeObject(cells);
            FileUtils.Save(fileFullPath, content);
        }

        public static List<Cell> Deserialize(string fileFullPath)//*直接返回Object
        {
            string content = FileUtils.Load(fileFullPath);
            return JsonConvert.DeserializeObject<List<Cell>>(content);
        }
    }
}

